<?php
include'connect.php';


try{
//"CREATE TABLE `sitegeist`.`tess` (`index` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `tag` VARCHAR(56) NOT NULL, `plugin` VARCHAR(56) NOT NULL, `page` VARCHAR(56) NOT NULL, `value` BLOB NOT NULL, UNIQUE (`plugin`)) CHARACTER SET utf8 COLLATE utf8_bin;";
//    $db->exec("create table `$name` (`index` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `tag` VARCHAR(56) NOT NULL, `plugin` VARCHAR(56) NOT NULL, `page` VARCHAR(56) NOT NULL, `value` BLOB NOT NULL, UNIQUE (`plugin`)) CHARACTER SET utf8 COLLATE utf8_bin;");
    $q=$db->prepare("insert into $hisite (tag,plugin,page,value) values(:tag,:plugin,:page,:value)");
    $q->execute(array(
        ":tag"=>$name,
        ":plugin"=>$plugin,
        ":page"=>"articles",
        ":value"=>""
    ));
}
catch (PDOException$e){
    switch($e->getCode()){
    default: echo'alert("error: ',$e->getMessage(),'");';
    }

}

//cleanup
unset($q);
$db=null;
//location.reload(); //js
?>
